#include <iostream>
//外观模式

class Light
{
public:
    void on()
    {
        std::cout<<"开灯"<<std::endl;
    }
    void off()
    {
        std::cout<<"关灯"<<std::endl;
    }
};


class Voice //音响
{
public:
    void on()
    {
        std::cout<<"开音响"<<std::endl;
    }
    void off()
    {
        std::cout<<"关音响"<<std::endl;
    }
};

class TV //电视
{
public:
    void on()
    {
        std::cout<<"开电视"<<std::endl;
    }
    void off()
    {
        std::cout<<"关电视"<<std::endl;
    }
};

class homeSystem
{
public:
    void sleep()
    {
        l.off();
        t.off();
        v.off();
    }
    void movie()
    {
        l.on();
        t.on();
        v.on();
    }

private:
    Light l;
    Voice v;
    TV t;
};

int main()
{
    homeSystem h;
    h.movie();
    return 0;
}